#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include"hotel.h"
int meun(void)
{
	int code = 0, status = 0;
	printf("\n%s%s\n", STARS, STARS);
	printf("Enter the number of the desired hotel:\n");
	printf("1.Fairfield Arms\t2.Hotel Olympic\n");
	printf("3.Chertworthy plaza\t4.The Stockton\n");
	printf("5.quit\n");
	printf("\n%s%s\n", STARS, STARS);
	while ((status = scanf("%d", &code)) != 1 || (code < 1 || code>5))
	{
		if (status != 1)
			scanf("%*s");
		printf("Enter an integer from 1 or 5, please.\n");
	}

	return code;
}

int getnights(void)
{
	int nights = 0;
	printf("How many nights are needed? ");
	while (scanf("%d", &nights) != 1)
	{
		scanf("%*s");
		printf("Please enter an integer, such as 2. \n");
	}

	return nights;
}

void showprice(double rate, int nights)
{
	int n = 0;
	double total = 0, factor = 1;
	for (n = 1; n <= nights; n++, factor *= DISCOUNT)
		total += rate * factor;
	printf("The total cost will be $%.2f.\n", total);
}